<template>
	<view class="exchangeDetails">
		<!-- 卡-图 banner -->
		<view class="banner">
			<image :src="data.bannerUrl" mode="aspectFit"></image>
		</view>
		
		<!-- 兑换码输入区-白色左上右上有圆角 -->
		<view class="Main">
			
			<view class="mainCon">
				<input
				      v-model="data.inputValue" 
				      placeholder="输入16位兑换码" 
				      @confirm="handleConfirm"
				    />
				<button type="primary">立即兑换</button>
			</view>
		</view>
		<!-- 兑换规则 -->
		<view class="footer">
			<view class="footerTitle">兑换规则</view>
			<view class="footerCon">
			  <rich-text :nodes="data.footerCon"></rich-text>
			</view>
		</view>
	</view>
</template>

<script lang="ts" setup>
	import {ref} from "vue";
	const data = ref({
		bannerUrl:"/static/exchangePage/cardBanner1.png",
		inputValue:'',
		footerCon:`
			<p>1、兑换后即可使用人岗匹配系统无次数限制。</p><br>
			<p>2、兑换后即日起一年有效期有效，兑换后不可撤回。</p><br>
			<p>3、使用过程中如遇问题随时联系客服解决。</p>
		`
	})
	
	const handleConfirm = () => {
		console.log('输入内容了')
	}
</script>

<style scoped>
/* 页面样式 */
.exchangeDetails {
	width: 100%;
	position: relative;
	background: #fff;
}
/* banner的容器 */
.banner {
	width: 100%;
	background: gold;
}
/* banner样式 */
.banner image {
	width: 100%;
	height: 266rpx;
}
/* 兑换码输入区-白色左上右上有圆角 */
.Main {
	width: 100%;
	background: #fff;
	position: absolute;
	top:250rpx;
	left: 0;
	border-radius: 26rpx 26rpx 0 0;  /* 左上和右上圆角 */
	/* height: 700rpx; */
	padding: 100rpx 85rpx 50rpx;
}
/* 输入框和按钮的容器 */
.mainCon {
	width: 100%;
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	/* background: greenyellow; */
	border-bottom: 2px dashed #eee;
}
/* 输入框-样式 */
.mainCon input {
	width: 100%;
	background: #f5f8fa;
	padding: 30rpx 0;
	font-size: 30rpx;
	text-align: center;
	border-radius: 16rpx;
	margin-bottom: 40rpx;
}
/* 按钮样式 */
.mainCon button {
	width: 100%;
	background: #e45159;
	margin-bottom: 60rpx;
	padding: 5rpx 0;
}
/* 底部：兑换规则 */
.footer {
	width: 100%;
	position: absolute;
	top:700rpx;
	left: 0;
	background: #fff;
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	padding-bottom: 300rpx;
}
.footerTitle {
	width: 100%;
	padding: 30rpx 0 50rpx 0;
	text-align: center;
	font-weight: bold;
	/* background: pink; */
}
.footerCon {
	width: 100%;
	padding: 0 70rpx;
	font-size: 24rpx;
	color: #aaa;
}
</style>
